<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class options_description</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp" title="Header &lt;boost/program_options/options_description.hpp&gt;">
<link rel="prev" href="options_descri_idp44766528.html" title="Class options_description_easy_init">
<link rel="next" href="duplicate_option_error.html" title="Class duplicate_option_error">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="options_descri_idp44766528.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="duplicate_option_error.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.program_options.options_description"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class options_description</span></h2>
<p>boost::program_options::options_description</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp" title="Header &lt;boost/program_options/options_description.hpp&gt;">boost/program_options/options_description.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="options_description.html#boost.program_options.options_descriptionconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="options_description.html#idp43056256-bb"><span class="identifier">options_description</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">,</span> 
                      <span class="keyword">unsigned</span> <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">/</span><span class="number">2</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="options_description.html#idp43057376-bb"><span class="identifier">options_description</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">,</span> 
                      <span class="keyword">unsigned</span> <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">/</span><span class="number">2</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="options_description.html#idp61941920-bb">public member functions</a></span>
  <span class="keyword">void</span> <a class="link" href="options_description.html#idp61942096-bb"><span class="identifier">add</span></a><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">&amp;</span> <a class="link" href="options_description.html#idp61943344-bb"><span class="identifier">add</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="options_descri_idp44766528.html" title="Class options_description_easy_init">options_description_easy_init</a> <a class="link" href="options_description.html#idp61944768-bb"><span class="identifier">add_options</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">&amp;</span> 
  <a class="link" href="options_description.html#idp67745152-bb"><span class="identifier">find</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">const</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">*</span> 
  <a class="link" href="options_description.html#idp45112352-bb"><span class="identifier">find_nothrow</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">,</span> <span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">shared_ptr</span><span class="special">&lt;</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <a class="link" href="options_description.html#idp43054304-bb"><span class="identifier">options</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="options_description.html#idp43054912-bb"><span class="identifier">print</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="options_description.html#idp43059136-bb">friend functions</a></span>
  <span class="keyword">friend</span> <span class="identifier">BOOST_PROGRAM_OPTIONS_DECL</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> 
  <a class="link" href="options_description.html#idp43059312-bb"><span class="keyword">operator</span><span class="special">&lt;&lt;</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">unsigned</span> <span class="identifier">m_default_line_length</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp121140576"></a><h2>Description</h2>
<p>A set of option descriptions. This provides convenient interface for adding new option (the add_options) method, and facilities to search for options by name.</p>
<p>See here for option adding interface discussion. </p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p><a class="link" href="option_description.html" title="Class option_description">option_description</a> </p>
<p>
</p>
<div class="refsect2">
<a name="idp121142256"></a><h3>
<a name="boost.program_options.options_descriptionconstruct-copy-destruct"></a><code class="computeroutput">options_description</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp43056256-bb"></a><span class="identifier">options_description</span><span class="special">(</span><span class="keyword">unsigned</span> line_length <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">,</span> 
                    <span class="keyword">unsigned</span> min_description_length <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">/</span><span class="number">2</span><span class="special">)</span><span class="special">;</span></pre>
<p>Creates the instance. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp43057376-bb"></a><span class="identifier">options_description</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> caption<span class="special">,</span> 
                    <span class="keyword">unsigned</span> line_length <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">,</span> 
                    <span class="keyword">unsigned</span> min_description_length <span class="special">=</span> <span class="identifier">m_default_line_length</span><span class="special">/</span><span class="number">2</span><span class="special">)</span><span class="special">;</span></pre>
<p>Creates the instance. The 'caption' parameter gives the name of this 'options_description' instance. Primarily useful for output. The 'description_length' specifies the number of columns that should be reserved for the description text; if the option text encroaches into this, then the description will start on the next line. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp121155024"></a><h3>
<a name="idp61941920-bb"></a><code class="computeroutput">options_description</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp61942096-bb"></a><span class="identifier">add</span><span class="special">(</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">&gt;</span> desc<span class="special">)</span><span class="special">;</span></pre>
<p>Adds new variable description. Throws duplicate_variable_error if either short or long name matches that of already present one. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">&amp;</span> <a name="idp61943344-bb"></a><span class="identifier">add</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">&amp;</span> desc<span class="special">)</span><span class="special">;</span></pre>
<p>Adds a group of option description. This has the same effect as adding all option_descriptions in 'desc' individually, except that output operator will show a separate group. Returns *this. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="options_descri_idp44766528.html" title="Class options_description_easy_init">options_description_easy_init</a> <a name="idp61944768-bb"></a><span class="identifier">add_options</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Returns an object of implementation-defined type suitable for adding options to <code class="computeroutput"><a class="link" href="options_description.html" title="Class options_description">options_description</a></code>. The returned object will have overloaded operator() with parameter type matching 'option_description' constructors. Calling the operator will create new <code class="computeroutput"><a class="link" href="option_description.html" title="Class option_description">option_description</a></code> instance and add it. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">&amp;</span> 
<a name="idp67745152-bb"></a><span class="identifier">find</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="keyword">bool</span> approx<span class="special">,</span> <span class="keyword">bool</span> long_ignore_case <span class="special">=</span> <span class="keyword">false</span><span class="special">,</span> 
     <span class="keyword">bool</span> short_ignore_case <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">*</span> 
<a name="idp45112352-bb"></a><span class="identifier">find_nothrow</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">,</span> <span class="keyword">bool</span> approx<span class="special">,</span> 
             <span class="keyword">bool</span> long_ignore_case <span class="special">=</span> <span class="keyword">false</span><span class="special">,</span> <span class="keyword">bool</span> short_ignore_case <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">shared_ptr</span><span class="special">&lt;</span> <a class="link" href="option_description.html" title="Class option_description">option_description</a> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <a name="idp43054304-bb"></a><span class="identifier">options</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp43054912-bb"></a><span class="identifier">print</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Outputs 'desc' to the specified stream, calling 'f' to output each <code class="computeroutput"><a class="link" href="option_description.html" title="Class option_description">option_description</a></code> element. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp121194096"></a><h3>
<a name="idp43059136-bb"></a><code class="computeroutput">options_description</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">friend</span> <span class="identifier">BOOST_PROGRAM_OPTIONS_DECL</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> 
<a name="idp43059312-bb"></a><span class="keyword">operator</span><span class="special">&lt;&lt;</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> os<span class="special">,</span> <span class="keyword">const</span> <a class="link" href="options_description.html" title="Class options_description">options_description</a> <span class="special">&amp;</span> desc<span class="special">)</span><span class="special">;</span></pre>
<p>Produces a human readable output of 'desc', listing options, their descriptions and allowed parameters. Other <code class="computeroutput"><a class="link" href="options_description.html" title="Class options_description">options_description</a></code> instances previously passed to add will be output separately. </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2002-2004 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0.
      (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at 
      <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="options_descri_idp44766528.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.options_description_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="duplicate_option_error.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
